<template>
	<view class="wf-box" :style="{ paddingTop: !isfrist? totalheight :'' }">
		<view class="head" :style="{ paddingTop: navBarHeight }"  v-if="!isfrist">
			<view class="head-np">
				<view class="back">
				</view>
			</view>
		</view>
		
		<view class="main"  v-if="!isfrist">
			<image src="../../static/img/sign-02.png" class="banner"></image>
			
			<view class="bar-im">
				<image src="../../static/img/logo.png"></image>
			</view>
			
			<view class="foot-btn" >
				<view class="sign" @click="sign()">注册</view>
				
				<view class="login" @click="next()">
					登录
				</view>
			</view>
		</view>
		<Open v-if="isfrist" @setFrist="setFrist()"></Open>
	</view>
</template>

<script>
	import { throttle } from '@/utils/common.js'
	import navBarMixin from '@/mixin/navBarMixin.js'
	import { psdLoginApi } from  '@/api/api.js'
	import Open from '@/pages/login/open.vue'
	export default {
		data() {
			return {
				phone: '',
				password: '',
				conPsd: '',
				isfrist: uni.getStorageSync('isFirstLaunch') || true,
			}
		},
		components: {
			Open
		},
		mixins: [navBarMixin],
		onShow() {
			// console.log(uni.getStorageSync('isFirstLaunch'));
			if(uni.getStorageSync('isFirstLaunch') ===false) {
				this.isfrist = uni.getStorageSync('isFirstLaunch')
			}else if(uni.getStorageSync('isFirstLaunch') ===true) {
				this.isfrist = uni.getStorageSync('isFirstLaunch')
			}
		},
		methods: {
			setFrist() {
				console.log(898989898);
				uni.setStorageSync('isFirstLaunch', false);
				this.isfrist = false
			},
			back() {
				uni.navigateBack()
			},
			next() {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			},
			
			sign() {
				uni.navigateTo({
					url: '/pages/login/setPassWord'
				})
			},
			
		},
	
		onLoad(option) {
			// console.log(uni.getStorageSync('userNo'))
			// if(!uni.getStorageSync('userNo')) {
			// 	uni.redirectTo({
			// 		url: '/pages/login/sign'
			// 	})
			// }
			
		}
		
	}
</script>

<style lang="scss" scoped>
	.wf-box {
		overflow: hidden;
		height: 100vh;
		background: url('../../static/img/sign-01.png') no-repeat;
		background-size: 100% 100%;
		box-sizing: border-box;
		.head {
			position: fixed;
			top: 0;
			z-index: 1;
			width: 100%;
			
			.head-np {
				display: flex;
				justify-content: space-between;
				align-items: center;
				width: 100%;
				height: 96rpx;
				padding: 0 30rpx;
				box-sizing: border-box;
				.back {
					color: #333;
					font-size: 28rpx;
					image {
						width: 20rpx;
						height: 37rpx;
					}
				}
				
			}
		}
		
		.main {
			padding: 0 30rpx;
			.banner {
				width: 100%;
				margin-top: 40rpx;
			}
			
			
			.bar-im {
				margin-top: 40rpx;
				image {
					display: block;
					margin: 0 auto;
					width: 200rpx;
					height: 200rpx;
				}
			}
			
			.foot-btn {
				margin-top: 50rpx;
				padding: 0 50rpx;
				.sign {
					margin-bottom: 40rpx;
					line-height: 80rpx;
					border-radius: 40rpx;
					text-align: center;
					color: #3F93FF;
					border: 2rpx solid #3F93FF;
					
				}
				.login {
					line-height: 80rpx;
					background: #3F93FF;
					border-radius: 40rpx;
					text-align: center;
					color: #fff;
				}
			}
			.foot-de {
				margin-top: 20rpx;
			}
		}
	}
</style>